package com.san.hkhospital.controller;
import com.san.hkhospital.entity.Department;
import com.san.hkhospital.service.DepartmentService;
import com.san.hkhospital.service.DeptSectionService;
import com.san.hkhospital.service.impl.DepartmentServiceImpl;
import com.san.hkhospital.vo.ResultVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
* (department)表控制层
*
* @author xxxxx
*/
@RestController
@RequestMapping("/department")
public class DepartmentController {
/**
* 服务对象
*/
@Resource
private DepartmentServiceImpl departmentServiceImpl;
@Autowired
    private DepartmentService departmentService;

    /**
* 通过主键查询单条数据
*
* @param id 主键
* @return 单条数据
*/
@GetMapping("selectOne")
public Department selectOne(Integer id) {
return departmentServiceImpl.selectByPrimaryKey(id);
}



    @RequestMapping("selectDepartment")
    public ResultVO selectDepartment(){
    return ResultVO.success("查询成功", departmentService.selectDepartment());
    }
}
